{extend name="public:_base" /}

{block name="main"}

<div class="user_conver">

    {include file="public:_right"}

    <!-- 查看考试结果 -->
    <div class="user_item my_data">
        <!-- 标题 -->
        <div class="user_item_title">
            <i class="glyphicon glyphicon-cog"></i>
            查看考试结果 <font>FIND EXAM</font>
        </div>
        <!-- #标题 -->

        <!-- 内容 -->
        <div class="user_item_cont user_info_cont">

            <div class="page-container">

                <div class="research-item-title">
                    <i class="glyphicon glyphicon-alert"></i> 注意: <font style="color: #ff0000;">字母红色为错误</font>, <font style="color: #008000;">字母绿色为正确</font>, 黑色字体为回答题
                </div>

                {volist name="list" id="answer" key="k"}
                <div class="research-item">

                    <div class="research-title">
                        {$k}：{$answer['question']['name']}
                        {neq name="$answer['question']['type']" value="2"}
                        <span class="re-one">
                正确答案：<b>{$answer['question']['answer']}</b>
            </span>
                        {else/}
                        <span class="re-tow">( 问答题所得分数: <font style="color: #be191f;font-weight: bold;">{$answer['contentscore']??0}分</font> )</span>
                        <span class="re-three">
                <input class="score" placeholder="自由答题分数" name="contentscore[{$answer['question']['id']}]" value="{$answer['contentscore']??0}" disabled type="text" style="display: none;">
            </span>
                        {/neq}
                        <span class="re-four">( 本题分数：{$answer['question']['point']??''} )</span>
                    </div>

                    <!-- 选择题目 -->
                    <div class="research-problem">
                        {neq name="$answer['question']['type']" value='2'}
                        {volist name="$answer['answerlist']" id="vo"}
                        <p>{$vo.question}：{$vo.name}</p>
                        {/volist}
                        {/neq}
                    </div>
                    <!-- #选择题目 -->

                    <!-- 自己选择答案 -->
                    <div class="research-answer">
                        你的答案:
                        {notempty name="$answer['answer']"}
                        <b>{$answer['answer']}</b>
                        {else}
                        <b>
                            放弃填写
                            <i class="glyphicon glyphicon-remove"></i>
                        </b>
                        {/notempty}
                    </div>
                    <!-- #自己选择答案 -->

                </div>
                {/volist}

                <!-- 答案结果 -->
                <div class="research-result">
                    <p class="research-result-one">
                        <b><i class="glyphicon glyphicon-share-alt" style="margin-right: 5px;"></i>得分如下: ( 最终分数结果 )</b>
                    </p>

                    <p class="research-result-two">
                        {empty name="type"}
                        <input id='score' type="number" disabled class="input-text" value="{$an.score ?? '0'}" placeholder="评分"  name="score">
                        {else}
                        <span style="margin-left: 5px;">选择题:{$count}分</span> + 回答题分数:{$scorecount??'0'}分
                        <input id="count" type="hidden" disabled class="input-text" value="{$count ?? '0'}" >
                        <span id="span"></span>
                        =
                        {$an.score ?? '0'}分
                        <input id='score' type="number" disabled class="input-text" value="{$an.score ?? '0'}" placeholder="评分" name="score" style="display: none;">
                        {/empty}
                    </p>
                </div>
                <!-- #答案结果 -->

            </div>

        </div>
        <!-- #内容 -->
    </div>
    <!-- #查看考试结果 -->

</div>

{/block}

{block name="js"}
<script type="text/javascript">
    $(".research-item").each(function () {
       var resTitle = $(this).find(".research-title .re-one b").text();
       var resAnswer = $(this).find(".research-answer b").text();
       if( resTitle == '' ){
           $(this).find(".research-answer b").css("color","#000000");
       } else if( resTitle == resAnswer ) {
           $(this).find(".research-answer b").css("color","#008000");
       } else {
           $(this).find(".research-answer b").css("color","#ff0000");
       }
    });
</script>
{/block}